package com.example.a1.myapplication.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import com.example.a1.myapplication.HoverButton;
import com.example.a1.myapplication.R;
import com.example.a1.myapplication.adapter.PurchaseAdapter;
import com.example.a1.myapplication.bean.MaterialBean;

import java.util.ArrayList;
import java.util.List;

public class HoverButtonActivity extends AppCompatActivity {

    private ListView listView;
    private List<MaterialBean.MaterielListBean> materialBeanList = new ArrayList<MaterialBean.MaterielListBean>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hover_button);
        listView = findViewById(R.id.lv);
        //传入上下文Activity
        HoverButton chatView = new HoverButton(this);
        chatView.show();
        MaterialBean.MaterielListBean bean = new MaterialBean.MaterielListBean();
        bean.setMateriel_number("13123131312312312312");
        bean.setRfid("20190719029");
        materialBeanList.add(bean);
        materialBeanList.add(bean);
        materialBeanList.add(bean);
        materialBeanList.add(bean);
        materialBeanList.add(bean);
        materialBeanList.add(bean);
        PurchaseAdapter adapter = new PurchaseAdapter(this, materialBeanList);
        listView.setAdapter(adapter);
        adapter.notifyDataSetChanged();
    }
}
